<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- STYLESHEETS --><!--[if lt IE 9]>
    <script src="../../js/flot/excanvas.min.js"></script>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script><![endif]-->
    <link rel="stylesheet" type="text/css" href="../../css/cloud-admin.css">
    <link rel="stylesheet" type="text/css" href="../../css/themes/default.css" id="skin-switcher">
    <link rel="stylesheet" type="text/css" href="../../css/responsive.css">

    <link href="../../font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <!-- SELECT2 -->
    <link rel="stylesheet" type="text/css" href="../../js/select2/select2.min.css"/>
    <!-- UNIFORM -->
    <link rel="stylesheet" type="text/css" href="../../js/uniform/css/uniform.default.min.css"/>
    <!-- datatable -->
    <link rel="stylesheet" href="../../js/datatables/datatable.css">

</head>
<body>
<header class="navbar clearfix" id="header">
</header>

<!-- PAGE -->
<section id="page">
    <!-- SIDEBAR -->
    <div id="sidebar" class="sidebar">
        <div class="sidebar-menu nav-collapse">

            <!-- SIDEBAR MENU -->
            <ul>

            </ul>
            <!-- /SIDEBAR MENU -->
        </div>

    </div>
    <!-- /SIDEBAR -->
    <div id="main-content">
        <div class="modal fade" id="update_barcode_config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">批量更新条码</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                                <span class="btn btn-success btn-file" id="fir" style="display: block">
                                    <input name="uploadFile" upload-file="uploadBarcode" type="file">
                                </span>
                            <span class="required">请使用商品列表中产品信息模板,请勿调整列顺序</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" id="update_sku_config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">修改参数</h4>
                    </div>
                    <div class="modal-body">
                        <form id="skuForm">
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">产品名称：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="tagName">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">

                                <label class="control-label col-md-3" style="line-height:34px;">尺码：</label>
                                <div class="col-md-8 " style="line-height:34px;">
                                    <input class="form-control" type="text" name="sizeDesc">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">成分含量：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="component1">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">产品等级：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="grade">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">执行标准：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="standard">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">安全类别：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="securityLevel">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">ABC婴儿：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="abcClass">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">标签价：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="tagPrice">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">检验员：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="checkupLevel">
                                </div>
                            </div>
                            <div class="form-group" style="margin-bottom:10px;">
                                <label class="control-label col-md-3" style="line-height:34px;">条码：</label>
                                <div class="col-md-8">
                                    <input class="form-control" style="height:34px" type="text" name="barCode">
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-success bt-update">保存</button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="row">
                <div id="content" class="col-lg-12">
                    <!-- PAGE HEADER-->
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="page-header">
                                <!-- STYLER -->

                                <!-- /STYLER -->
                                <!-- BREADCRUMBS -->
                                <ul class="breadcrumb">
                                    <li>
                                        <i class="fa fa-home"></i>
                                        <a href="../index.html">首页</a>
                                    </li>
                                    <li>
                                        <a href="#">商品管理</a>
                                    </li>
                                    <li>商品列表</li>
                                </ul>
                                <!-- /BREADCRUMBS -->

                            </div>
                        </div>
                    </div>
                    <!-- /PAGE HEADER -->
                    <!-- FORMS QUERY-->
                    <div class="row">
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="box border primary">
                                        <div class="box-title">
                                            <h4><i class="fa fa-bars"></i>查询条件</h4>
                                        </div>
                                        <div class="box-body big" style="padding:10px;">
                                            <form class="form-horizontal" role="form" id="exportForm" action="../../admin/adminsku/exportSku.do">
                                                <div class="form-group mrg-bt10">
                                                    <label class="col-sm-1 control-label" style="width: auto">商品编码：</label>
                                                    <div class="col-sm-2">
                                                        <input type="text" class="form-control" name="productCode" placeholder="请输入商品编码">
                                                    </div>
                                                    <label class="col-sm-1 control-label" style="width: auto">SKU编码：</label>
                                                    <div class="col-sm-2">
                                                        <input type="text" class="form-control" name="skuCode" placeholder="输入关键字">
                                                    </div>
                                                    <label class="col-sm-1 control-label" style="width: auto">商品名称：</label>
                                                    <div class="col-sm-2">
                                                        <input type="text" class="form-control" name="productName" placeholder="输入关键字">
                                                    </div>
                                                </div>
                                                <div class="form-group mrg-bt10">
                                                    <label class="col-sm-1 control-label" style="width: auto">条 形 码：</label>
                                                    <div class="col-sm-2">
                                                        <input type="text" class="form-control" name="barCode" placeholder="输入条码按回车">
                                                    </div>
                                                    <div class="col-sm-1">
                                                        <a class="btn btn-primary search">查询</a>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- /FORMS QUERY -->
                        <div class="row" style="height: 30px;">
                            <div class="col-md-12">
                                <div class="box ">
                                    <a href="import_sku_material.html" class="btn btn-success ">
                                        <i class="fa  fa-plus-square-o"></i>导入数据
                                    </a>
                                    <a href="javaScript:;" id="importBarcode" class="btn btn-success ">
                                        <i class="fa  fa-plus-square-o"></i> 更新条码
                                    </a>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <!-- TABLES -->
                            <div class="col-md-12">
                                <!-- BOX -->
                                <div class="box border primary">
                                    <div class="box-title">
                                        <h4><i class="fa fa-table"></i>商品数：<span id="total"></span>条 </h4>
                                    </div>
                                    <div class="box-body">
                                        <table id="db_product_list" cellpadding="0" cellspacing="0" border="0"
                                               class="datatable table table-striped table-bordered table-hover">

                                        </table>
                                    </div>
                                </div>
                                <!-- /BOX -->
                            </div>
                        </div>
                        <!-- /TABLES -->


                        <div class="footer-tools">
							<span class="go-top">
								<i class="fa fa-chevron-up"></i> Top
							</span>
                        </div>
                    </div><!-- /CONTENT-->
                </div>
            </div>
        </div>
    </div>
</section>
<!--/PAGE -->
<!-- JAVASCRIPTS -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- JQUERY -->
<script src="../../js/jquery/jquery-2.0.3.min.js"></script>
<!-- JQUERY UI-->
<script src="../../js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
<!-- BOOTSTRAP -->
<script src="../../bootstrap-dist/js/bootstrap.min.js"></script>
<!-- BLOCK UI -->
<script type="text/javascript" src="../../js/jQuery-BlockUI/jquery.blockUI.min.js"></script>

<!-- AUTOSIZE -->
<script type="text/javascript" src="../../js/autosize/jquery.autosize.min.js"></script>
<!-- spinner -->
<script src="../../js/spinner/spin.js"></script>
<!-- DATA TABLES -->
<script type="text/javascript" src="../../js/datatables/bootstrap-select.js"></script>
<script type="text/javascript" src="../../js/datatables/datatable.js"></script>
<script type="text/javascript" src="../../js/datatables/datatable-bootstrap.js"></script>
<script type="text/javascript" src="../../js/datatables/datatable-tabletools.js"></script>
<script type="text/javascript" src="../../js/datatables/fnAddTr.js"></script>
<!-- bootstrap-fileupload -->
<script type="text/javascript" src="../../js/jquery-upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="../../js/jquery-upload/js/jquery.fileupload.min.js"></script>
<script type="text/javascript" src="../../js/jquery-upload/js/jquery.fileupload-process.min.js"></script>
<script type="text/javascript" src="../../js/jquery-upload/js/jquery.fileupload-validate.min.js"></script>
<!-- INPUT MASK -->
<script type="text/javascript" src="../../js/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
<!--bootbox-->
<script type="text/javascript" src="../../js/bootbox/bootbox.min.js"></script>
<!-- SELECT2 -->
<script type="text/javascript" src="../../js/select2/select2.min.js"></script>
<!-- UNIFORM -->
<script type="text/javascript" src="../../js/uniform/jquery.uniform.min.js"></script>
<script language="javascript" type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
<!-- COOKIE -->
<script type="text/javascript" src="../../js/jQuery-Cookie/jquery.cookie.min.js"></script>
<!-- CUSTOM SCRIPT -->
<script src="../../js/script.js"></script>
<script src="../../js/common.js"></script>
<script language="javascript" src="../../js/print/LodopFuncs.js"></script>
<script>
    var Product = function () {
        var $mainDataTable = null;
        var productCode = null;

        var searchProduct = function () {

            var productCode = $("input[name=productCode]").val();
            var skuCode = $("input[name=skuCode]").val();
            var url = App.getContextPath() + "admin/skumaterial/searchSkuList.do?productCode=" + productCode + "&skuCode=" + skuCode + "&productName=" + $("[name=productName]").val() + "&barCode=" + $("[name=barCode]").val();

            if ($mainDataTable) {
                $mainDataTable.api().ajax.url(url).load();
                return;
            }
            var dtSetting = $.dataTableSetting({
                "ajaxSource": url,
                "serverSide": true,
                "bFilter": false,// 去掉搜索框
                "bLengthChange": true,// 每页显示数量
                "sScrollX": "100%",
                "sScrollXInner": "100%",
                "iDisplayLength": 25,

                "bSort": false,
                "aoColumns": [{
                    "mDataProp": "productCode",
                    "sTitle": "商品编码",
                    "width": "10%",
                    "class": "productCode"
                }, {
                    "mDataProp": "tagName",
                    "sTitle": "商品名称",
                    "width": "20%"

                }, {
                    "mDataProp": "skuCode",
                    "sTitle": "SKU编码",
                    "width": "10%",
                    "class": "skuCode"
                }, {
                    "mDataProp": "sizeDesc",
                    "sTitle": "尺码 ",
                    "width": "10%"

                }, {
                    "mDataProp": "barCode",
                    "sTitle": "条形码 ",
                    "width": "10%"

                }
                    , {
                        "sTitle": "操作",
                        "width": "20%",
                        "render": function (data, type, row) {
                            var str = "<a class='btn btn-success btn-xs bt-print btn-width' barcode=" + row.barCode + " style='width:80px' href='javascript:;'><i class='fa fa-pencil-square-o'></i>打印贴纸<form id=" + row.barCode + " action='../../admin/skumaterial/printSkuMaterial.do'></form></a>";
                            str += "<a class='btn btn-warning btn-xs bt-edit btn-width' barcode=" + row.barCode + " skuCode=" + row.skuCode + " style='width:60px;margin-left:10px' href='javascript:;'><i class='fa fa-pencil-square-o'></i>编辑</a>";
                            str += "<a class='btn btn-success btn-xs bt-printBrand btn-width' barcode=" + row.barCode + " style='width:80px' href='javascript:;'><i class='fa fa-pencil-square-o'></i>打印吊牌</a>";

                            return str;
                        }
                    }, {
                        "mDataProp": "id",
                        "class": "id hide"
                    }]
            });

            $mainDataTable = $("#db_product_list").dataTable(dtSetting);
        };
        var exportSku = function () {

        }

        var printBrand = function (barCode) {
            $.ajax({
                type: "post",
                url: App.getContextPath() + "admin/skumaterial/getSkuMaterial.do",
                data: {barCode: barCode},
                async: true,
                success: function (result) {
                    if (result.component11 == null) {
                        $.alert("没有维护贴纸内容");
                        $(".search").click(searchProduct);
                    } else {
                        var LODOP;
                        LODOP = getLodop();
                        LODOP.PRINT_INITA(0, 0, 450, 700, "");
                        LODOP.SET_PRINTER_INDEX("TSC TTP-244 Pro")
                        LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE", 1);
                        LODOP.ADD_PRINT_BARCODE(214, 13, 190, 35, "128Auto", result.barCode);
                        LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
                        LODOP.ADD_PRINT_TEXT(251, 17, 148, 31, "RMB:" + result.tagPrice + "元");
                        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
                        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                        LODOP.ADD_PRINT_TEXT(7, 32, 100, 20, "合格证");
                        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                        LODOP.ADD_PRINT_TEXT(32, 5, 72, 20, "品    牌：");
                        if(result.createBy!='Yiigoo&TMHW'&&result.createBy!='Yiigoo&xxby')
                        LODOP.ADD_PRINT_TEXT(30, 62, 95, 25, "壹果Yiigoo");
                        else
                        LODOP.ADD_PRINT_TEXT(30, 62, 95, 25, result.createBy);                        
                        LODOP.ADD_PRINT_TEXT(50, 5, 74, 20, "品    名：");
                        LODOP.ADD_PRINT_TEXT(50, 64, 119, 20, result.tagName);
                        LODOP.ADD_PRINT_TEXT(68, 5, 71, 20, "颜    色：");
                        LODOP.ADD_PRINT_TEXT(89, 5, 71, 20, "款    号：");
                        LODOP.ADD_PRINT_TEXT(109, 5, 69, 20, "执行标准：");
                        LODOP.ADD_PRINT_TEXT(129, 5, 73, 20, "安全类别：");
                        LODOP.ADD_PRINT_TEXT(149, 5, 73, 20, "检 验 员：");
                        LODOP.ADD_PRINT_TEXT(169, 5, 73, 20, "等    级：");
                        LODOP.ADD_PRINT_TEXT(189, 5, 73, 20, "尺    码：");
                        LODOP.ADD_PRINT_TEXT(67, 61, 100, 20, result.color);
                        if (result.productCode.length > 6)
                            LODOP.ADD_PRINT_TEXT(89, 62, 100, 20, result.productCode.substr(0, 6));
                        else
                            LODOP.ADD_PRINT_TEXT(89, 62, 100, 20, result.productCode);

                        LODOP.ADD_PRINT_TEXT(108, 63, 100, 20, result.standard);
                        LODOP.ADD_PRINT_TEXT(129, 65, 100, 20, result.securityLevel);
                        LODOP.ADD_PRINT_TEXT(149, 65, 100, 20, result.checkupLevel);
                        LODOP.ADD_PRINT_TEXT(169, 66, 100, 20, result.grade);
                        LODOP.ADD_PRINT_TEXT(189, 66, 100, 20, result.sizeDesc);
                        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                        LODOP.PREVIEW();

                    }
                }
            })
        }
        return {

            init: function () {

                $(".search").click(searchProduct);
                searchProduct();
                $("#db_product_list").on("click", ".bt-edit", function () {
                    var barCode = $(this).attr("barCode");
                    var skuCode = $(this).attr("skuCode");
                    $.ajax({
                        type: "post",
                        url: App.getContextPath() + "admin/skumaterial/getSkuMaterial.do",
                        data: {barCode: barCode},
                        async: false,
                        success: function (result) {
                            $("#update_sku_config").modal("show");
                            $("#update_sku_config").find("[name=sizeDesc]").val(result.sizeDesc);
                            $("#update_sku_config").find("[name=grade]").val(result.grade);
                            $("#update_sku_config").find("[name=securityLevel]").val(result.securityLevel);
                            $("#update_sku_config").find("[name=standard]").val(result.standard);
                            var component = [];
                            if (result.component1 != null && result.component1 != "")
                                component.push(result.component1)
                            if (result.component2 != null && result.component2 != "")
                                component.push(result.component2)
                            if (result.component3 != null && result.component3 != "")
                                component.push(result.component3)
                            if (result.component4 != null && result.component4 != "")
                                component.push(result.component4)
                            if (result.component5 != null && result.component5 != "")
                                component.push(result.component5)


                            $("#update_sku_config").find("[name=component1]").val(component.join(";"));
                            $("#update_sku_config").find("[name=checkupLevel]").val(result.checkupLevel);
                            $("#update_sku_config").find("[name=tagPrice]").val(result.tagPrice);
                            $("#update_sku_config").find("[name=barCode]").val(result.barCode);
                            $("#update_sku_config").find("[name=tagName]").val(result.tagName);
                            $("#update_sku_config").find("[name=abcClass]").val(result.abcClass);
                            $("#update_sku_config").find(".bt-update").unbind("click").bind("click", function () {
                                var skus = [];
                                var sku = $("#skuForm").serializeObject();
                                sku.skuCode = skuCode;
                                //拆分成分含量

                                if (sku.component1 != "") {
                                    var c = sku.component1.split(";");
                                    if (c.length >= 1)
                                        sku.component1 = c[0];
                                    if (c.length >= 2)
                                        sku.component2 = c[1];
                                    if (c.length >= 3)
                                        sku.component3 = c[2];
                                    if (c.length >= 4)
                                        sku.component4 = c[3];
                                    if (c.length >= 5)
                                        sku.component5 = c[4];
                                }


                                skus.push(sku);
                                $.ajax({
                                    type: "post",
                                    url: App.getContextPath() + "admin/skumaterial/saveBatchSku.do",
                                    data: {skus: JSON.stringify(skus)},
                                    async: true,
                                    success: function (result) {
                                        $.alert("更新成功");
                                        $("#update_sku_config").modal("hide");
                                    }
                                });
                            });
                        }
                    });
                });
                $("[name=barCode]").keydown(function (e) {

                    if (e.keyCode == "13")
                        printSku($.trim($(this).val()));
                });
                var printSku = function (barCode) {

                    $(".search").off("click");
                    $.ajax({
                        type: "post",
                        url: App.getContextPath() + "admin/skumaterial/getSkuMaterial.do",
                        data: {barCode: barCode},
                        async: true,
                        success: function (result) {
                            if (result.component11 == null) {
                                $.alert("没有维护贴纸内容");
                                $(".search").click(searchProduct);
                            } else {

                                var LODOP;
                                LODOP = getLodop();
                                LODOP.PRINT_INIT("");
                                //LODOP.SET_PRINTER_INDEX("TSC TTP-244 Pro")
                                LODOP.SET_PRINT_PAGESIZE(1, 700, 500, "");
                                LODOP.ADD_PRINT_IMAGE(12, 0, 100, 51, "<img src='http://m.yiigoo.com/images/logo.png'/>");

                                LODOP.SET_PRINT_STYLEA(0, "Stretch", 2);
                                LODOP.ADD_PRINT_TEXT(4, 106, 45, 16, "产品名称");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);

                                var p = result.tagName;
                                if (p.indexOf(" ") > -1) {
                                    p = p.replace(" ", "");
                                }
                                LODOP.ADD_PRINT_TEXT(5, 140, 110, 16, p);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

                                if (result.grade != "") {
                                    LODOP.ADD_PRINT_TEXT(35, 106, 45, 16, "产品等级");
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.ADD_PRINT_TEXT(35, 150, 100, 16, result.grade);
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                }
                                if (result.standard != "") {
                                    LODOP.ADD_PRINT_TEXT(51, 106, 45, 16, "执行标准");
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.ADD_PRINT_TEXT(50, 148, 100, 16, result.standard);
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                }
                                if (result.securityLevel != null && result.securityLevel.length > 1) {
                                    LODOP.ADD_PRINT_TEXT(66, 106, 45, 16, "安全类别");
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.ADD_PRINT_TEXT(66, 150, 100, 16, result.securityLevel);
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                    LODOP.ADD_PRINT_TEXT(80, 150, 100, 16, result.abcClass);
                                    LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                    LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                }
                                LODOP.ADD_PRINT_TEXT(58, -8, 95, 10, "合格证");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_LINE(72, -15, 71, 95, 0, 1);
                                LODOP.ADD_PRINT_TEXT(76, -8, 100, 20, result.sizeDesc);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_LINE(100, -15, 99, 95, 0, 1);
                                LODOP.ADD_PRINT_TEXT(94, 106, 45, 16, "检验");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.ADD_PRINT_TEXT(94, 150, 100, 16, result.checkupLevel);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Black");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_TEXT(109, 106, 144, 16, "洗涤方式见耐久性标签");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                var s21 = result.component21;
                                var s22 = result.component22;
                                var s11 = result.component11;
                                var s12 = result.component12;

                                if (result.component21 == "" && result.component22 == "") {
                                    s21 = result.component11;
                                    s22 = result.component12;
                                    s11 = "";
                                    s12 = "";
                                }

                                LODOP.ADD_PRINT_TEXT(101, 1, 39, 10, s11);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_TEXT(101, -2, 100, 10, s12);

                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.ADD_PRINT_TEXT(111, 1, 28, 11, s21);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_TEXT(111, -2, 100, 10, s22);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.ADD_PRINT_BARCODE(122, 106, 150, 35, "128Auto", result.barCode);
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
                                LODOP.ADD_PRINT_TEXT(169, 106, 145, 12, "壹果企画（北京）科技有限公司");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_TEXT(180, 106, 145, 12, "地址：北京市朝阳区曙光西里甲10号三楼");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_LINE(159, -15, 158, 95, 0, 1);
                                LODOP.ADD_PRINT_TEXT(172, 0, 51, 16, "建议零售价");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.ADD_PRINT_TEXT(171, 32, 55, 25, result.tagPrice + "元");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_TEXT(122, 1, 33, 16, result.component31);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_TEXT(122, -2, 100, 10, result.component32);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);

                                LODOP.ADD_PRINT_TEXT(19, 106, 42, 16, "产品颜色");
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.ADD_PRINT_TEXT(19, 140, 110, 16, result.color);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                                LODOP.ADD_PRINT_TEXT(133, 1, 34, 20, result.component41);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_TEXT(132, -2, 100, 10, result.component42);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
                                LODOP.ADD_PRINT_TEXT(143, 2, 34, 10, result.component51);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.ADD_PRINT_TEXT(143, -2, 100, 10, result.component52);
                                LODOP.SET_PRINT_STYLEA(0, "FontName", "Noto Sans S Chinese Regular");
                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);

                                LODOP.SET_PRINT_STYLEA(0,"HtmWaitMilSecs",1000);
                                LODOP.PREVIEW();
                                $("[name=barCode]").val('');
                                $(".search").click(searchProduct);
                                //LODOP.PRINT();
                            }
                            //$(this).find("form").empty().append("<input type='hidden' name=barCode value='"+$(this).attr("barcode")+"'/>")

                            //$(this).find("form").submit();


                        }
                    })
                }

                $("#db_product_list").on("click", ".bt-print", function () {
                    printSku($(this).attr("barCode"))
                });
                $("#db_product_list").on("click", ".bt-printBrand", function () {
                    printBrand($(this).attr("barCode"))
                });

                $("#importBarcode").click(function () {
                    $("#update_barcode_config").modal("show");
                });
                $("[upload-file=uploadBarcode]").fileupload({
                    url: App.getContextPath() + "admin/skuImport/importBarcode.do",
                    dataType: 'json',
                    acceptFileTypes: /(\.|\/)(xlsx|xls)$/i,
                    iframe: true,
                    start: function (e) {
                        $.blockUI();
                        $('.progress').fadeIn(300);
                        return true;
                    },
                    autoUpload: true,
                    done: function (e, data) {
                        $.unblockUI();
                        $.alert(data.result.content);
                        if (data.result.type === 'success') {
                            $("#update_barcode_config").modal("hide");
                        }

                    },
                    progressall: function (e, data) {

                        var progress = parseInt(data.loaded / data.total * 100, 10);
                        $('.progress .progress-bar').css('width', progress + '%');
                    }
                }).on('fileuploaddone', function (e, data) {
                    $(".progress").fadeOut(300);

                });
            }
        }

        }();


    $(function () {
        $("#header").load("../head.html");
        App.init(); //Initialise plugins and elements
        Product.init();


    });
</script>
<!-- /JAVASCRIPTS -->
</body>
</html>